<?php

/**
 * Helper to implementation of hook_content_default_fields().
 */
function _sponsors_content_default_fields() {
  $fields = array();

  // Exported field: field_sponsor_logo
  $fields[] = array(
    'field_name' => 'field_sponsor_logo',
    'type_name' => 'sponsor',
    'display_settings' => array(
      'weight' => '33',
      'parent' => '',
      'token' => array(
        'format' => 'top_banner_linkimage',
        'exclude' => 0,
      ),
      '2' => array(
        'format' => 'top_banner_linkimage',
        'exclude' => 0,
      ),
      '3' => array(
        'format' => 'top_banner_linkimage',
        'exclude' => 0,
      ),
      '4' => array(
        'format' => 'top_banner_linkimage',
        'exclude' => 0,
      ),
      'label' => array(
        'format' => 'above',
      ),
      'teaser' => array(
        'format' => 'top_banner_linkimage',
        'exclude' => 0,
      ),
      'full' => array(
        'format' => 'top_banner_linkimage',
        'exclude' => 0,
      ),
    ),
    'widget_active' => '1',
    'type' => 'filefield',
    'required' => '1',
    'multiple' => '0',
    'module' => 'filefield',
    'active' => '1',
    'list_field' => '0',
    'list_default' => 1,
    'description_field' => '0',
    'widget' => array(
      'file_extensions' => 'png gif jpg jpeg',
      'file_path' => '',
      'progress_indicator' => 'bar',
      'max_filesize_per_file' => '',
      'max_filesize_per_node' => '',
      'max_resolution' => '0',
      'min_resolution' => '0',
      'alt' => '',
      'custom_alt' => 0,
      'title' => '',
      'custom_title' => 0,
      'title_type' => 'textfield',
      'default_image' => NULL,
      'use_default_image' => 0,
      'url' => '',
      'custom_target' => 0,
      'target' => '_blank',
      'nofollow' => 0,
      'label' => 'Sponsor Logo',
      'weight' => '33',
      'description' => 'The logo to be displayed for this sponsor, along with an URL that it needs to point to.',
      'type' => 'linkimagefield_widget',
      'module' => 'linkimagefield',
    ),
  );

  // Translatables
  array(
    t('Sponsor Logo'),
  );

  return $fields;
}

/**
 * Helper to implementation of hook_imagecache_default_presets().
 */
function _sponsors_imagecache_default_presets() {
  $items = array(
    'side_sponsor' => array(
      'presetname' => 'side_sponsor',
      'actions' => array(
        '0' => array(
          'weight' => '0',
          'module' => 'imagecache',
          'action' => 'imagecache_scale',
          'data' => array(
            'width' => '309',
            'height' => '100%',
            'upscale' => 0,
          ),
        ),
      ),
    ),
    'top_banner' => array(
      'presetname' => 'top_banner',
      'actions' => array(
        '0' => array(
          'weight' => '0',
          'module' => 'imagecache',
          'action' => 'imagecache_scale',
          'data' => array(
            'width' => '400',
            'height' => '100%',
            'upscale' => 0,
          ),
        ),
      ),
    ),
  );
  return $items;
}

/**
 * Helper to implementation of hook_user_default_permissions().
 */
function _sponsors_user_default_permissions() {
  $permissions = array();

  // Exported permission: access content
  $permissions[] = array(
    'name' => 'access content',
    'roles' => array(
      '0' => 'anonymous user',
      '1' => 'authenticated user',
      '2' => 'author_role',
      '3' => 'editor',
      '4' => 'site_manager',
      '5' => 'speaker',
    ),
  );

  // Exported permission: create sponsor content
  $permissions[] = array(
    'name' => 'create sponsor content',
    'roles' => array(
      '0' => 'site_manager',
    ),
  );

  // Exported permission: delete any sponsor content
  $permissions[] = array(
    'name' => 'delete any sponsor content',
    'roles' => array(
      '0' => 'site_manager',
    ),
  );

  // Exported permission: delete own sponsor content
  $permissions[] = array(
    'name' => 'delete own sponsor content',
    'roles' => array(
      '0' => 'site_manager',
    ),
  );

  // Exported permission: edit any sponsor content
  $permissions[] = array(
    'name' => 'edit any sponsor content',
    'roles' => array(
      '0' => 'site_manager',
    ),
  );

  // Exported permission: edit field_sponsor_logo
  $permissions[] = array(
    'name' => 'edit field_sponsor_logo',
    'roles' => array(
      '0' => 'author_role',
      '1' => 'editor',
      '2' => 'site_manager',
    ),
  );

  // Exported permission: edit own sponsor content
  $permissions[] = array(
    'name' => 'edit own sponsor content',
    'roles' => array(
      '0' => 'site_manager',
    ),
  );

  // Exported permission: view field_sponsor_logo
  $permissions[] = array(
    'name' => 'view field_sponsor_logo',
    'roles' => array(
      '0' => 'anonymous user',
      '1' => 'authenticated user',
      '2' => 'author_role',
      '3' => 'editor',
      '4' => 'site_manager',
      '5' => 'speaker',
    ),
  );

  // Exported permission: view imagecache side_sponsor
  $permissions[] = array(
    'name' => 'view imagecache side_sponsor',
    'roles' => array(
      '0' => 'site_manager',
    ),
  );

  // Exported permission: view imagecache top_banner
  $permissions[] = array(
    'name' => 'view imagecache top_banner',
    'roles' => array(
      '0' => 'site_manager',
    ),
  );

  return $permissions;
}
